package com.etc.service;

import com.etc.dao.EquipmentDAO;
import com.etc.dao.RoleEquipmentDAO;
import com.etc.entity.Equipment;
import com.etc.entity.RoleEquipment;

public class RoleEquipmentService {

	RoleEquipmentDAO reDao = new RoleEquipmentDAO();
	//添加一个角色装备，有五件
	public void addRoleEquip(RoleEquipment roleEquip) {
		reDao.addRoleEquip(roleEquip);
	}
	
	public RoleEquipment findREById(String reId) {
		RoleEquipment re = reDao.findREById(reId);
		return re;
	}
	
	
	//测试
	public static void main(String[] args) {
		EquipmentDAO equipDao1 = new EquipmentDAO();
		RoleEquipmentService reService = new RoleEquipmentService();
		Equipment equip1 = equipDao1.findEquipById("038efbe0");
		Equipment equip2 = equipDao1.findEquipById("038efbe0");
		Equipment equip3 = equipDao1.findEquipById("67a2f25b");
		Equipment equip4 = equipDao1.findEquipById("0d2865b4");
		Equipment equip5 = equipDao1.findEquipById("67aa258e");
		Equipment equip6 = equipDao1.findEquipById("f0f2d642");
		RoleEquipment re = new RoleEquipment(equip1, equip2, equip3, equip4, equip5, equip6);
		reService.addRoleEquip(re);
		
//		RoleEquipment re = reService.findREById("3fbf25a3");
//		System.out.println(re.toString());
	}
}
